package com.porterhead.configuration;

import com.porterhead.account.AccountService;
import com.porterhead.account.AccountServiceImpl;
import com.porterhead.account.resource.AccountResource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.validation.Validator;

@Configuration
public class AccountConfiguration {

    @Autowired
    private Validator validator;

    @Bean
    public AccountService accountService() {
        return new AccountServiceImpl(validator);
    }

    @Bean
    public AccountResource accountResource() {
        return new AccountResource(accountService());
    }
}
